import * as creditApi from "../../api/credit_manage";

const creditManage = {
  namespaced: true,
  state: {},
  actions: {
    async fetchCreditApplyList({ commit }, searchObj) {
      let respData = await creditApi.getCreditApplyList(searchObj);
      respData = respData.data;
      return new Promise(resolve => {
        resolve(respData);
      });
    },
    async handleCreditApply({ commit }, updateObj) {
      let respData = await creditApi.handleCreditApply(updateObj);
      respData = respData.data;
      return new Promise(resolve => {
        resolve(respData);
      });
    },
    async fetchCreditDetail({ commit }, searchObj) {
      let respData = await creditApi.getCreditDetail();
      respData = respData.data;
      return new Promise(resolve => {
        resolve(respData);
      });
    }
  }
};

export default creditManage;
